import axios from 'axios';

const service = axios.create({
  baseURL: 'http://localhost:9091/',
  timeout: 5000
  // headers: { 'Content-Type': 'application/json' }
});
service.interceptors.request.use(config => {
  const token = window.sessionStorage.getItem('token');
  config.headers.Authorization = token;
  config.headers.token = token;

  return config;
}, error => {
  Promise.reject(error);
});
service.interceptors.response.use(response => {
  return response.data;
}, error => {
  Promise.reject(error);
});
export default service;
